import Service from '@/api/config/request'

/**
 * @description: 登陆，返回携带cookies，不携带用户信息
 * @return {Promise}
 * @param account 账号
 * @param pwd 密码
 * }
 */
export const loginIn = (account,pwd) => {
  return Service.request({
    data: {
      account,
      pwd,
    },
    url:  '/api/auth/login',
    method: 'POST',
  })
}
/**
 * @description: 注册用户
 * @return {Promise}
 * @param account 账号
 * @param pwd 密码
 * @param confirmPwd 确认密码
 */
export const register = (account, pwd,confirmPwd) => {
  return Service.request({
    data: {
      account,
      pwd,
      confirmPwd,
    },
    url:  '/api/auth/register',
    method: 'POST',
  })
}
/**
 * @description: 退出登陆
 * @return {Promise}
 */
export const loginOut = () => {
  return Service.request({
    url:  '/api/auth/logout',
    method: 'POST',
  })
}
